home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / contrib / pdcurs22 / src / portable / terminfo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-26  |  2.6 KB  |  83 lines

  1. /*
  2. ***************************************************************************
  3. * This file comprises part of PDCurses. PDCurses is Public Domain software.
  4. * You may use this code for whatever purposes you desire. This software
  5. * is provided AS IS with NO WARRANTY whatsoever.
  6. * Should this software be used in another application, an acknowledgement
  7. * that PDCurses code is used would be appreciated, but is not mandatory.
  8. *
  9. * Any changes which you make to this software which may improve or enhance
  10. * it, should be forwarded to the current maintainer for the benefit of 
  11. * other users.
  12. *
  13. * The only restriction placed on this code is that no distribution of
  14. * modified PDCurses code be made under the PDCurses name, by anyone
  15. * other than the current maintainer.
  16. * See the file maintain.er for details of the current maintainer.
  17. ***************************************************************************
  18. */
  19. #define    CURSES_LIBRARY    1
  20. #include <curses.h>
  21.  
  22. /* undefine any macros for functions defined in this module */
  23. #undef    mvcur
  24.  
  25. /* undefine any macros for functions called by this module if in debug mode */
  26. #ifdef PDCDEBUG
  27. #endif
  28.  
  29. #ifdef PDCDEBUG
  30. char *rcsid_terminfo  = "$Id$";
  31. #endif
  32.  
  33. /*man-start*********************************************************************
  34.  
  35.   Name:                                                      terminfo
  36.  
  37.   Synopsis:
  38.       int mvcur(int oldrow, int oldcol, int newrow, int newcol)
  39.  
  40.   X/Open Description:
  41.      The mvcur() function controls low-level cursor motion with 
  42.      optimization.
  43.  
  44.      NOTE: The remainer of the terminfo functions have not been
  45.              implemented.
  46.  
  47.   X/Open Return Value:
  48.      All functions return OK on success and ERR on error.
  49.  
  50.   X/Open Errors:
  51.      No errors are defined for this function.
  52.  
  53.   Portability                             X/Open    BSD    SYS V
  54.                                           Dec '88
  55.       mvcur                                 Y        Y       Y
  56.  
  57. **man-end**********************************************************************/
  58.  
  59. /***********************************************************************/
  60. int    mvcur(int oldrow, int oldcol, int newrow, int newcol)
  61. /***********************************************************************/
  62. {
  63. #ifdef PDCDEBUG
  64.     if (trace_on) PDC_debug("mvcur() - called: oldrow %d oldcol %d newrow %d newcol %d\n",oldrow,oldcol,newrow,newcol);
  65. #endif
  66.  
  67. #ifdef    TC
  68. #  pragma argsused
  69. #endif
  70.     if ((newrow >= LINES)    ||
  71.         (newcol >= COLS)    ||
  72.         (newrow < 0)    ||
  73.         (newcol < 0))
  74.     {
  75.         return( ERR );
  76.     }
  77.     PDC_gotoxy( newrow, newcol );
  78.     _cursvar.cursrow = newrow;
  79.     _cursvar.curscol = newcol;
  80.     return( OK );
  81. }
  82.